<!DOCTYPE html>
<html>
<!--
	<head>
		<meta charset="utf-8">
		<title>发布题目</title>
		<script src="../static/jquery-3.4.1.js"></script>
	</head>
	<body>
		<form action="" method="post">
			请输入题目名称<input type="text" name="name" placeholder="请输入题目名称"/><br/>
			请输入题目内容<textarea name="context" placeholder="请输入题目内容" style="width: 80%; height: 300px"></textarea>
			请输入类型<input type="text" name="type" placeholder="在这里输入题目类型"/><br/>
			<div id="testInstance" style="border-style: solid;">
				<div style="border-style: solid;">
					测试用例内容<textarea name="testcontext1" placeholder="请输入测试用例内容"></textarea>
					测试用例结果<textarea name="testrst1" placeholder="请输入测试用例结果"></textarea>
				</div>
			</div>
			<input id="count" type="hidden" name="count" value="1"/>
			<input id="newTest" type="button" name="addone"  value="增加一个测试用例"/>
			<input style="float:right" type="submit" name="submit" value="提交"/>
-->
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1.0">
        <link rel="stylesheet" href="{{ url_for('static', filename='Home.CSS') }}">
        <script src="../static/jquery-3.4.1.js"></script>
        <title>Release</title>
    </head>

    <body>

        <header>
            <nav>
                <ul>
<!--
                    <li><a href="index.html">首页</a></li>
                    <li><a href="QuestionBank.html">题库</a></li>
                    <li><a href="Competition.html">比赛</a></li>
                    <li><a href="Release.html">我要发布</a></li>
                    <div>
                        <li><a href="login.html">登录/注册</a></li>
-->
                    <li><a href="{{ url_for('homepage') }}">首页</a></li>
                    <li><a href="{{ url_for('questions') }}">题库</a></li>
                    <li><a href="{{ url_for('competition') }}">比赛</a></li>
                    <li><a href="{{ url_for('release') }}">我要发布</a></li>
                    <div>
                        <li><a href="{{ url_for('login') }}">登录/注册</a></li>
<!--python-->
                    </div>
                </ul>
                <div class="spe">
                    <ul>
                        <li><img src="{{ url_for('static', filename='./img/mark.png') }}" width="80px" height=80px" alt="logo"></li>
                        <li><h1>发布习题</h1></li>
                    </ul>
                </div>
            </nav>
        </header>
 

    <section class="Release">
        <form action="{{ url_for('release') }}" method="post">
			<div class="alldiv">
				<div class="description">
					<div>
						<p>请输入题目名称:</p>
						<input type="text" name="name" placeholder="请输入题目名称"/>
					</div>
			
					<div>
						<p>请输入题目类别:</p>
						<input type="text" name="type" placeholder="请输入题目类别"/><br/>
					</div>
				</div>
				<div class="text">
					<p>请输入题目内容:</p>
					<textarea name="context" placeholder="请输入题目内容" style="width: 80%; height: 300px"></textarea>
				</div>

				<div class="attribute" id="testInstance">
					<div>
						<p>测试用例内容:</p>
						<textarea name="testcontext1" placeholder="请输入测试用例内容"></textarea>
					</div>

					<div>
						<p>测试用例结果:</p>
						<textarea name="testrst1" placeholder="请输入测试用例结果"></textarea>
					</div>
				</div>
				
				<div class="button">
					<input id="count" type="hidden" name="count" value="1"/>
					<input id="newTest" type="button" name="addone"  value="增加一个测试用例"/>
					<input type="submit" name="submit" value="提交"/>
				</div>
			</div>
		</form>
		<script>
			window.onload = function(){
				$("#newTest").click(function(){
					document.getElementById("count").value++;
					var value = document.getElementById("count").value;
						$("#testInstance").append("<br/><div><p>测试用例内容</p><textarea name=\"testcontext" + value + '"' + " placeholder=\"请输入测试用例内容\"></textarea></div><div><p>测试用例结果</p><textarea name=\"testrst" + value + '"' + " placeholder=\"请输入测试用例结果\"></textarea></div>");
				});
			}
		</script>
    </section>

    <footer>
        Welcome to contact us with <a href="https://github.com/VisualGMQ" target="view-window">https://github.com/VisualGMQ</a>
    </footer>
    </body>
</html>